<?php
session_cache_expire(999999999);
if(!isset($_SESSION)) 
{ 
session_start(); 
} 
include '../../operations/connection.php';

if(isset($_REQUEST['usname'])){
	$alert="";
	
	$query="SELECT e.UserName from employee e where trim(e.UserName)=trim('".$_REQUEST['usname']."')";
	$m1=mysql_query($query);
	if(mysql_num_rows($m1)>0){
		$alert .="Username already existed!";
	}
	
if($alert==""){
		$_SESSION['checkdb_username']="okk";
	}else{
		$_SESSION['checkdb_username']=$alert;
	}
}
?>

<input type="hidden" id="viewcheckdb_username" value="<?php echo $_SESSION['checkdb_username'];?>" />

<?php 
//echo $query."<br>";
mysql_close($connection);
?>